package structs;
  // ����ṹ��???
  typedef struct packed {
    // �Ƿ�Ӵ洢��д�ؼĴ���???
    logic memtoreg;
    // �Ƿ�д�洢��
    logic memwrite;
    // �Ƿ���?
    logic branch;
    // alu�ĵڶ�����������������
    logic alusrc;
    // д�صļĴ�����rt����rd
    logic regdst;
    // �Ƿ�д�ؼĴ���
    logic regwrite;
    // �Ƿ���ת
    logic jump;
    // Load Word
    logic [2:0] lordD;
    logic [2:0] storeD;
    // compare control for branch inst
    logic [3:0] cmpcontrol;
    // for jr inst
    logic jumpreg;
    logic jumplink;
    logic jumplinkreg;
    // cp0 write enable
    logic cp0we;
    // cp0 read
    logic cp0read;
    //exception
    logic invalid;
    logic breakpoint;
    logic syscall;
    logic eret;
  } control_sign_t;
  
  
  typedef struct packed {
    // fetch stage
    logic [31:0] pcF;
    // decode stage
    logic equalD;
    logic [5:0] opD, functD;
    logic [31:0] instrD;
    // execute stage
    logic flushE;
    logic stallE;
    // mem stage
    logic [31:0] aluoutM, writedataM;
    logic flushM;
    logic stallM;
    // write back stage
    logic stallW;
    logic flushW;
    logic[31:0] debugPCW;
    logic[4:0] writeregW;
    logic[31:0] resultW;
    //axi
    logic stallF;
    logic stallreg_from_if,stallreg_from_mem;
    logic except_jumpM;
  } datapath_sign_out_t;
  
  typedef struct packed {
    // decode stage
    logic pcsrcD,branchD,jumpD,regdstD;
    // for jr inst
    logic jumpregD;
    // from controller to datapath D for comparing to branch
    logic [3:0] cmpcontrolD;
    logic jumplinkD;
    logic jumplinkregD;
    // execute stage
    logic memtoregE,alusrcE;
    logic regdstE,regwriteE;
    logic [4:0] alucontrolE;
    logic jumplinkE;
    logic jumplinkregE;
    // cp0 write enable
    logic cp0weE;
    // cp0 read
    logic cp0readE;
    // mem stage
    logic memtoregM,memwriteM,regwriteM;
    logic cp0weM;
    logic cp0readM;
    // wb stage
    logic memtoregW,regwriteW;
    logic cp0readW;
    // Load Word
    logic [2:0] lordE,lordM;
    logic [2:0] storeE,storeM;
    //exception
    logic invalidD;
    logic breakpointD;
    logic syscallD;
    logic eretD;
  } controller_sign_out_t;
endpackage